var express = require('express');
var router = express.Router();
var multiparty = require('multiparty')
var multipart = require('connect-multiparty');
var multipartMiddleware = multipart();

var articleController = require("../controller/articleController")

//添加文章
router.post('/add', articleController.add)

//删除文件
router.get('/delete', articleController.delete)

//文件上传
router.post('/upload', articleController.upload);

//获取所有文章
router.get('/', articleController.list);

//渲染写文章页面
router.get('/write', articleController.write)

//渲染详情页
router.get('/detail', articleController.detail)

module.exports = router;